﻿using Minecraft.BLL.mysql;
using Minecraft.Config;
using Minecraft.Config.Csv.CsvCls;
using Minecraft.Model;
using Minecraft.Model.Backpack;
using Minecraft.Model.Furniture;
using Minecraft.Model.ReqResp;
using SuperSocket.SocketBase.Command;
using SuperSocket.SocketBase.Protocol;
using System;
using System.Collections.Generic;
using System.Linq;

namespace Minecraft.ServerHall.Cmd
{
	public class BackpackGoodsExchange : CommandBase<MinecraftSession, StringRequestInfo>
	{
		public override string Name
		{
			get
			{
				return ProtocolHelper.GetProtocolStr(defCommand);
			}
		}
		private EnumCommand defCommand = EnumCommand.Backpack_BackpackGoodsExchange;
		public override void ExecuteCommand(MinecraftSession session, StringRequestInfo requestInfo)
		{
			var req = requestInfo.GetRequestObj<BackpackGoodsExchangeReq>(session);
			if (req == null)
			{
				session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误1：（原因：请求实体为空）" });
				return;
			}
			if (!session.minecraftSessionInfo.IsLogin)
			{
				session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "未登录" });
				return;
			}

			if (req.GoodsPositionSource < 0)
			{
				session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误4：（原因：GoodsPositionSource < 0）" });
				return;
			}
			if (req.GoodsPositionTarget < 0)
			{
				session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误5：（原因：GoodsPositionTarget < 0）" });
				return;
			}

			var enumGoodsExchangeObjectTypeList = EnumGoodsExchangeObjectType.Other.GetEnumDesxriptionDict().Select(k => (EnumGoodsExchangeObjectType)k.Key).ToList();
			if (!enumGoodsExchangeObjectTypeList.Any(m => m == req.enumGoodsExchangeObjectType))
			{
				session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = $"错误1：（原因：针对物品交换接口操作对象类型不正确，传过来的为【{req.enumGoodsExchangeObjectType.ToString()}】）" });
				return;
			}

			switch (req.enumGoodsExchangeObjectType)
			{
				case EnumGoodsExchangeObjectType.FurnitureOutput:
					{
						#region FurnitureOutput
						defCommand = EnumCommand.Furniture_FurnitureOutputGoodsMove;
						//if (JsonConfig.Value.IsDebug)
						//{
						//	req = new FurnitureOutputGoodsMoveReq
						//	{
						//		furnitureId = session.minecraftSessionInfo.furnitureList.FirstOrDefault().FurnitureId,
						//		enumGoodsBelongsToTypeSource = EnumGoodsBelongsToType.Backpack,
						//		enumGoodsBelongsToTypeTarget = EnumGoodsBelongsToType.FurnitureOutput,
						//		GoodsPositionSource = (from inf in session.minecraftSessionInfo.goodsList.GetBackpackGoodsCellInfo()
						//							   where inf.enumGoodsBelongsToType == EnumGoodsBelongsToType.Backpack
						//							   && inf.GoodsItemId == "100000"
						//							   && inf.GoodsList.Count() > 0
						//							   select inf).ToList().FirstOrDefault().GoodsPosition,
						//		GoodsPositionTarget = 0,
						//		//GoodsPositionSource = 1,
						//		//GoodsPositionTarget = (from inf in session.GetBackpackGoodsItemInfoList()
						//		//					   where inf.enumGoodsBelongsToType == EnumGoodsBelongsToType.Backpack
						//		//					   && inf.GoodsNum <= 0
						//		//					   select inf).ToList().FirstOrDefault().GoodsPosition
						//	};
						//}

						////暂时写死
						//req.guid = session.minecraftSessionInfo.furnitureOutputList.FirstOrDefault().FurnitureId;

						if (req.guid.IsNullOrWhiteSpace())
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误3：（原因：furnitureId参数为空）" });
							return;
						}

						//类型限制
						List<EnumGoodsBelongsToType> typeList = new List<EnumGoodsBelongsToType>()
						{
							EnumGoodsBelongsToType.ShortcutBar,
							EnumGoodsBelongsToType.Backpack,
							EnumGoodsBelongsToType.FurnitureOutput,
						};
						if (!typeList.Any(m => m == req.enumGoodsBelongsToTypeSource))
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = $"错误5：（原因：传入的类型不在此范围【enumGoodsBelongsToTypeSource：{req.enumGoodsBelongsToTypeSource.ToString()}】）" });
							return;
						}
						if (!typeList.Any(m => m == req.enumGoodsBelongsToTypeTarget))
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = $"错误5：（原因：传入的类型不在此范围【enumGoodsBelongsToTypeTarget：{req.enumGoodsBelongsToTypeTarget.ToString()}】）" });
							return;
						}
						if (MinecraftConfig.bpShortbarBelongsToTypeList.Any(m => m == req.enumGoodsBelongsToTypeSource) && MinecraftConfig.bpShortbarBelongsToTypeList.Any(m => m == req.enumGoodsBelongsToTypeTarget))
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = $"错误5：（原因：两种类型不能同属于快捷栏或者背包）" });
							return;
						}
						//两种类型不能相同
						if (req.enumGoodsBelongsToTypeSource == req.enumGoodsBelongsToTypeTarget)
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误6：（原因：源物品类型和目标物品类型不能相同）" });
							return;
						}
						//获取产出家具信息
						var furniture = session.minecraftSessionInfo.furnitureOutputList.FirstOrDefault(m => m.FurnitureId == req.guid);
						if (furniture == null)
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误7：（原因：该产出家具信息不存在）" });
							return;
						}
						if (furniture.Hp <= 0)
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误8：（原因：家具 Hp <= 0）" });
							return;
						}
						//if (JsonConfig.Value.IsDebug)
						//{
						//	//furniture.MaterialGoodsItemIdsPosAndNums = "100000#0#6|100001#1#8";
						//	furniture.MaterialGoodsItemIdsPosAndNums = "100000#0#6";
						//	//furniture.timeTicksStr = DateTimeOffset.Now.AddSeconds(-500).Ticks.ToString();
						//	furniture.timeTicksStr = "";
						//	furniture.ResultGoodsNum = 1;
						//	furniture.ResultGoodsItemId = "140000";
						//}

						FurnitureOutputUpgradeInfo furnitureOutputUpgradeInfo = furniture.GetFurnitureOutputUpgradeInfo(session);
						//查看升级状态
						if (furniture.Upgrade_State_Convert)
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误3：（原因：正在升级中，不能调用该接口）" });
							return;
						}
						//暂存操作之前的数据
						var beforeFurnitureInfo = furniture.DeepCopy();

						var baseRespSource = req.enumGoodsBelongsToTypeSource.GetFurnitureGoodsMovePosBelongsToTypeBaseType(req.guid, req.GoodsPositionSource, session, "BackpackGoodsExchange");
						if (baseRespSource.RespLevel != RespLevelEnum.Success)
						{
							session.Send(defCommand, req, baseRespSource);
							return;
						}
						var baseRespTarget = req.enumGoodsBelongsToTypeTarget.GetFurnitureGoodsMovePosBelongsToTypeBaseType(req.guid, req.GoodsPositionTarget, session, "BackpackGoodsExchange");
						if (baseRespTarget.RespLevel != RespLevelEnum.Success)
						{
							session.Send(defCommand, req, baseRespTarget);
							return;
						}

						Mod_Drawing mod_Furniture = furniture.GetMod_FurnitureInfo();
						if (mod_Furniture == null)
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误8：（原因：mod_Furniture 配置表不存在）" });
							return;
						}

						//添加操作影响的positionOptList
						List<BackpackGoodsPositionOpt> positionOptList = new List<BackpackGoodsPositionOpt>();

						//源位置是背包
						if (MinecraftConfig.bpShortbarBelongsToTypeList.Any(m => m == req.enumGoodsBelongsToTypeSource))
						{
							//背包数据（源位置）
							var backpackGoodsInfo = session.minecraftSessionInfo.goodsList.FirstOrDefault(m =>
								m.enumGoodsBelongsToType_Convert == req.enumGoodsBelongsToTypeSource
								&& m.GoodsPosition == req.GoodsPositionSource && m.Num > 0);
							if (backpackGoodsInfo == null)
							{
								session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误8：（原因：源位置中的格子物品数量为空）" });
								return;
							}

							//产出家具（目标位置）
							bool isProduct = false;
							int num = 0;
							var furnitureOutputMaterialGoodsInfo = furniture.GetFurnitureOutputMaterialGoodsInfoList_Convert().FirstOrDefault(m => m.GoodsPosition == req.GoodsPositionTarget);
							var cellTotalNum = furniture.GetMod_FurnitureInfo().GetCellTotalNum_Convert(furniture.Level);
							if (req.GoodsPositionTarget == cellTotalNum - 1) //产物位置
							{
								isProduct = true;
							}
							else
							{
								isProduct = false;
							}

							if (isProduct)
							{
								session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误8：（原因：不能拖放到产物格子）" });
								return;
							}

							if (!isProduct)
							{
								//如果家具需要燃料，并且拖到家具的位置在燃料位置上，如果放置的物品不是燃料，则不允许放置
								if (mod_Furniture.If_buring_Convert)
								{
									if (req.GoodsPositionTarget == cellTotalNum - 2) //燃料位置
									{
										//Mod_Items mod_Items = CsvConfig.itemsList.FirstOrDefault(m => m.Id == backpackGoodsInfo.GoodsItemId);
										Mod_Items mod_Items = CsvConfig.GetMod_ItemsInfoById(backpackGoodsInfo.GoodsItemId);
										if (mod_Items == null)
										{
											session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误8：（原因：mod_Items 配置表不存在）" });
											return;
										}
										if (mod_Items.modAttributeInfo_Convert == null || mod_Items.modAttributeInfo_Convert.enumAttribute != EnumAttribute.BurnVal)
										{
											session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误8：（原因：燃料框只能拖放燃料，所以操作失败）" });
											return;
										}
									}
									else //配方位置
									{
										//判断是否是配方的一种
										var isRecipe = furniture.isFurnitureOutputRecipe(backpackGoodsInfo.GoodsItemId);
										if (!isRecipe)
										{
											session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = $"错误8：（原因：该物品【backpackGoodsList.FirstOrDefault().GoodsItemId：{backpackGoodsInfo.GoodsItemId}】不属于配方，不允许拖动到配方格子中1）" });
											return;
										}
									}
								}
								else //不需要燃料
								{
									//判断是否是配方的一种
									var isRecipe = furniture.isFurnitureOutputRecipe(backpackGoodsInfo.GoodsItemId);
									if (!isRecipe)
									{
										session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = $"错误8：（原因：该物品【backpackGoodsList.FirstOrDefault().GoodsItemId：{backpackGoodsInfo.GoodsItemId}】不属于配方，不允许拖动到配方格子中2）" });
										return;
									}
								}

								//如果源位置与目标位置是相同物品，或者目标格子为空
								if (furnitureOutputMaterialGoodsInfo != null && furnitureOutputMaterialGoodsInfo.GoodsItemId == backpackGoodsInfo.GoodsItemId
									|| furnitureOutputMaterialGoodsInfo == null)
								{
									if (furnitureOutputMaterialGoodsInfo == null)
									{
										furnitureOutputMaterialGoodsInfo = new FurnitureOutputMaterialGoodsInfo
										{
											Num = 0,
											GoodsPosition = req.GoodsPositionTarget,
											GoodsItemId = backpackGoodsInfo.GoodsItemId
										};
									}
									num = furnitureOutputMaterialGoodsInfo.Num;

									//从配置中读取指定物品存放数量上限（由于源格子与目标格子的物品ItemId相同，所以可以选择源格子的物品ItemId）
									var destGoodsItemMaxNum = session.GetMaxCellNumConvert(backpackGoodsInfo.GoodsItemId);
									if (num >= destGoodsItemMaxNum)
									{
										session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误12：（原因：移动无效，交换相同物品时，会产生堆叠，如果目标位置已经满了，则无法操作）" });
										return;
									}
									//判断目标位置还可以放多少个，才能放满
									var subValue = destGoodsItemMaxNum - num;
									var canTakeNum = Math.Min(subValue, backpackGoodsInfo.Num);
									//var takeGoodsSourceList = backpackGoodsInfo.Take(subValue).ToList();
									backpackGoodsInfo.Num -= canTakeNum;
									//这里有Goods GUID 的消失
									//takeGoodsSourceList.ForEach(item =>
									//{
									//	session.minecraftSessionInfo.goodsList.RemoveAll(m => m.GoodsId == item.GoodsId);
									//});
									//将背包格子中的物品移动到产出家具的格子中
									if (!isProduct)
									{
										furnitureOutputMaterialGoodsInfo.Num += canTakeNum;
										//主动触发元素属性值的改变事件
										furniture.TransformListToOutput_MaterialGoodsItemIdsPosAndNums_Convert(furnitureOutputMaterialGoodsInfo);
									}
									else
									{
										furniture.Output_ResultGoodsItemId = backpackGoodsInfo.GoodsItemId;
										furniture.Output_ResultGoodsNum += canTakeNum;
									}

								}
								else
								{
									//交换
									//backpackGoodsInfo.ForEach(item =>
									//{
									//	session.minecraftSessionInfo.goodsList.RemoveAll(m => m.GoodsId == item.GoodsId);
									//});
									////移动到背包
									//for (int i = 0; i < furnitureOutputMaterialGoodsInfo.Num; i++)
									//{
									//	session.minecraftSessionInfo.goodsList.Add(new GoodsModel()
									//	{
									//		BelongsTo = (int)req.enumGoodsBelongsToTypeSource,
									//		guid = "",
									//		GoodsId = StringHelper.GetGuidStr(),
									//		PlayerId = session.minecraftSessionInfo.player.PlayerId,
									//		GoodsPosition = req.GoodsPositionSource,
									//		GoodsItemId = furnitureOutputMaterialGoodsInfo.GoodsItemId,
									//		WastageValue = 100
									//	});
									//}

									var backpackGoodsInfoCopy = backpackGoodsInfo.DeepCopy();

									backpackGoodsInfo.BelongsTo = (int)req.enumGoodsBelongsToTypeTarget;
									backpackGoodsInfo.GoodsId = StringHelper.GetGuidStr();
									backpackGoodsInfo.GoodsItemId = furnitureOutputMaterialGoodsInfo.GoodsItemId;
									backpackGoodsInfo.GoodsPosition = furnitureOutputMaterialGoodsInfo.GoodsPosition;
									backpackGoodsInfo.guid = req.guid;
									backpackGoodsInfo.Num = furnitureOutputMaterialGoodsInfo.Num;
									//goodsSourceInfo.PlayerId = destinationCopy.PlayerId;
									backpackGoodsInfo.WastageValue = 100;

									furnitureOutputMaterialGoodsInfo.GoodsItemId = backpackGoodsInfoCopy.GoodsItemId;
									furnitureOutputMaterialGoodsInfo.Num = backpackGoodsInfoCopy.Num;
									//主动触发元素属性值的改变事件
									furniture.TransformListToOutput_MaterialGoodsItemIdsPosAndNums_Convert(furnitureOutputMaterialGoodsInfo);
								}
								//移动成功
								positionOptList.Add(new BackpackGoodsPositionOpt
								{
									enumGoodsBelongsToType = req.enumGoodsBelongsToTypeSource,
									GoodsPosition = req.GoodsPositionSource,
									guid = backpackGoodsInfo.guid
								});
								positionOptList.Add(new BackpackGoodsPositionOpt
								{
									enumGoodsBelongsToType = req.enumGoodsBelongsToTypeTarget,
									GoodsPosition = req.GoodsPositionTarget,
									guid = furniture.FurnitureId
								});
							}
							else
							{
								//是产物
								if (!furniture.Output_ResultGoodsItemId.IsNullOrWhiteSpace() && furniture.Output_ResultGoodsItemId != backpackGoodsInfo.GoodsItemId)
								{
									session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误11：（原因：源格子为背包中的格子，源格子与目标格子存放不同物品，并且目标格子不为空，则无法移动）" });
									return;
								}

							}
						}
						//源位置是产出家具
						else
						{
							//产出家具（源位置）
							string goodsItemId = "";
							int num = 0;

							bool isProduct = false;
							var furnitureOutputMaterialGoodsInfo = furniture.GetFurnitureOutputMaterialGoodsInfoList_Convert().FirstOrDefault(m => m.GoodsPosition == req.GoodsPositionSource);
							var cellTotalNum = furniture.GetMod_FurnitureInfo().GetCellTotalNum_Convert(furniture.Level);
							if (req.GoodsPositionSource == cellTotalNum - 1) //产物位置
							{
								isProduct = true;
							}
							else
							{
								isProduct = false;
							}
							if (!isProduct)
							{
								if (furnitureOutputMaterialGoodsInfo == null)
								{
									session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误13：（原因：源位置中的格子物品数量为空）" });
									return;
								}
								goodsItemId = furnitureOutputMaterialGoodsInfo.GoodsItemId;

								/*
								 * 如果是燃料，并且正在燃烧中，则正在燃烧中的燃料不能取出，即取出的燃料数量要减去1
								 * 如果正在燃烧中，并且数量小于等于1，则返回错误信息
								 */
								var fuelInfo = CsvConfig.GetMod_ItemsInfoById(furnitureOutputMaterialGoodsInfo.GoodsItemId);
								if (fuelInfo != null && fuelInfo.modAttributeInfo_Convert.enumAttribute == EnumAttribute.BurnVal) //如果如果当前处于是燃料
								{
									EnumFuelBurnState enumFuelBurnState = furniture.GetFurnitureOutputFuelBurnState(session);
									if (mod_Furniture.If_buring_Convert
										&& req.GoodsPositionSource == mod_Furniture.GetCellTotalNum_Convert(furniture.Level) - 2
										&& enumFuelBurnState == EnumFuelBurnState.InTheCombustion)
									{
										if (furnitureOutputMaterialGoodsInfo.Num <= 1)
										{
											session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误13：（原因：仅剩余一个燃料，并且正在燃烧，不能取出）" });
											return;
										}
										num = furnitureOutputMaterialGoodsInfo.Num - 1;
									}
									else
									{
										num = furnitureOutputMaterialGoodsInfo.Num;
									}
								}
								else
								{
									num = furnitureOutputMaterialGoodsInfo.Num;
								}
							}
							else
							{
								//是产物
								if (furniture.Output_ResultGoodsItemId.IsNullOrWhiteSpace())
								{
									session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误14：（原因：源位置（家具）中的产物格子物品ItemId为空）" });
									return;
								}
								if (!session.IsExistItemsOrBlocks(furniture.Output_ResultGoodsItemId))
								{
									session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误15：（原因：源位置（家具）中的产物格子物品或者方块不存在）" });
									return;
								}
								if (furniture.Output_ResultGoodsNum <= 0)
								{
									session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误16：（原因：源位置（家具）中的产物格子物品或者方块个数小等于0）" });
									return;
								}
								goodsItemId = furniture.Output_ResultGoodsItemId;
								num = furniture.Output_ResultGoodsNum;
							}

							//背包数据（目标位置）
							var backpackGoodsInfo = session.minecraftSessionInfo.goodsList.FirstOrDefault(m =>
								 m.enumGoodsBelongsToType_Convert == req.enumGoodsBelongsToTypeTarget
								&& m.GoodsPosition == req.GoodsPositionTarget);
							//如果源位置与目标位置是相同物品，或者目标格子为空
							if (backpackGoodsInfo != null && backpackGoodsInfo.GoodsItemId == goodsItemId
								|| (backpackGoodsInfo == null)
								)
							{
								if (backpackGoodsInfo == null)
								{
									backpackGoodsInfo = new GoodsModel()
									{
										BelongsTo = (int)req.enumGoodsBelongsToTypeTarget,
										GoodsId = StringHelper.GetGuidStr(),
										GoodsPosition = req.GoodsPositionTarget,
										GoodsItemId = goodsItemId,
										Num = 0,
										guid = "",
										PlayerId = session.minecraftSessionInfo.player.PlayerId,
										WastageValue = 100
									};
									session.minecraftSessionInfo.goodsList.Add(backpackGoodsInfo);
								}
								//从配置中读取指定物品存放数量上限（由于源格子与目标格子的物品ItemId相同，所以可以选择源格子的物品ItemId）
								var destGoodsItemMaxNum = session.GetMaxCellNumConvert(goodsItemId);
								//判断目标位置还可以放多少个，才能放满
								var subValue = destGoodsItemMaxNum - backpackGoodsInfo.Num;
								//得到可以移动的个数
								var canMoveNum = Math.Min(subValue, num);

								////此处有新的goods GUID 产生
								//List<GoodsModel> newGoodsList = new List<GoodsModel>();
								//for (int canMoveIndex = 0; canMoveIndex < canMoveNum; canMoveIndex++)
								//{
								//	GoodsModel goodsModel = new GoodsModel
								//	{
								//		BelongsTo = (int)req.enumGoodsBelongsToTypeTarget,
								//		GoodsId = StringHelper.GetGuidStr(),
								//		GoodsItemId = goodsItemId,
								//		GoodsPosition = req.GoodsPositionTarget,
								//		PlayerId = session.minecraftSessionInfo.player.PlayerId,
								//		WastageValue = 100,
								//		guid = "",
								//	};
								//	newGoodsList.Add(goodsModel);
								//}

								backpackGoodsInfo.Num += canMoveNum;

								//更新源格子的物品个数
								if (!isProduct)
								{
									furnitureOutputMaterialGoodsInfo.Num -= canMoveNum;
									furniture.TransformListToOutput_MaterialGoodsItemIdsPosAndNums_Convert(furnitureOutputMaterialGoodsInfo);
								}
								else
								{
									furniture.Output_ResultGoodsNum -= canMoveNum;
								}
							}
							else
							{
								//交换，不同物品
								if (!isProduct)
								{
									var isRecipe = furniture.isFurnitureOutputRecipe(backpackGoodsInfo.GoodsItemId);

									if (!isRecipe)
									{
										session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误8：（原因：要交换的物品不属于配方，不允许交换）" });
										return;
									}

									////交换
									//backpackGoodsInfo.ForEach(item =>
									//{
									//	session.minecraftSessionInfo.goodsList.RemoveAll(m => m.GoodsId == item.GoodsId);
									//});

									////此处有新的goods GUID 产生
									//List<GoodsModel> newGoodsList = new List<GoodsModel>();
									//for (int i = 0; i < num; i++)
									//{
									//	GoodsModel goodsModel = new GoodsModel
									//	{
									//		BelongsTo = (int)req.enumGoodsBelongsToTypeTarget,
									//		GoodsId = StringHelper.GetGuidStr(),
									//		GoodsItemId = goodsItemId,
									//		GoodsPosition = req.GoodsPositionTarget,
									//		PlayerId = session.minecraftSessionInfo.player.PlayerId,
									//		WastageValue = 100,
									//		guid = "",
									//		 Num = 
									//	};
									//	newGoodsList.Add(goodsModel);
									//}
									////更新目标格子的物品
									//session.minecraftSessionInfo.goodsList.AddRange(newGoodsList);

									var backpackGoodsInfoCopy = backpackGoodsInfo.DeepCopy();

									backpackGoodsInfo.BelongsTo = (int)req.GoodsPositionSource;
									backpackGoodsInfo.GoodsId = StringHelper.GetGuidStr();
									backpackGoodsInfo.GoodsItemId = furnitureOutputMaterialGoodsInfo.GoodsItemId;
									backpackGoodsInfo.GoodsPosition = furnitureOutputMaterialGoodsInfo.GoodsPosition;
									backpackGoodsInfo.guid = req.guid;
									backpackGoodsInfo.Num = furnitureOutputMaterialGoodsInfo.Num;
									//goodsSourceInfo.PlayerId = destinationCopy.PlayerId;
									backpackGoodsInfo.WastageValue = 100;

									furnitureOutputMaterialGoodsInfo.GoodsItemId = backpackGoodsInfoCopy.GoodsItemId;
									furnitureOutputMaterialGoodsInfo.Num = backpackGoodsInfoCopy.Num;
									furniture.TransformListToOutput_MaterialGoodsItemIdsPosAndNums_Convert(furnitureOutputMaterialGoodsInfo);
								}
								else
								{
									session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误16：（原因：如果背包中有物品，则不能从产出家具的产物格子移动到背包中与产物不同的格子中）" });
									return;
								}

							}
							//移动成功
							positionOptList.Add(new BackpackGoodsPositionOpt
							{
								enumGoodsBelongsToType = req.enumGoodsBelongsToTypeSource,
								GoodsPosition = req.GoodsPositionSource,
								guid = furniture.FurnitureId
							});
							positionOptList.Add(new BackpackGoodsPositionOpt
							{
								enumGoodsBelongsToType = req.enumGoodsBelongsToTypeTarget,
								GoodsPosition = req.GoodsPositionTarget,
								guid = backpackGoodsInfo.guid
							});
						}

						//change时间ticks
						var separatorChar = '|';
						var timeNow = DateTimeOffset.Now;

						//获取之前的产出条件
						EnumFurnitureOutputState enumFurnitureOutputStateBefore = beforeFurnitureInfo.GetFurnitureOutputState(session);
						//获取之后的产出条件
						EnumFurnitureOutputState enumFurnitureOutputStateAfter = furniture.GetFurnitureOutputState(session);
						switch (enumFurnitureOutputStateBefore)
						{
							case EnumFurnitureOutputState.NotStart:
								{
									switch (enumFurnitureOutputStateAfter)
									{
										case EnumFurnitureOutputState.NotStart:
											{
												furniture.Output_timeTicksStr = "";
											}
											break;
										case EnumFurnitureOutputState.Progressing:
											{
												furniture.Output_timeTicksStr = timeNow.Ticks.ToString();
											}
											break;
										case EnumFurnitureOutputState.PauseIn:
											{
												//不存在这种情况
											}
											break;
										default:
											break;
									}
								}
								break;
							case EnumFurnitureOutputState.Progressing:
								{
									switch (enumFurnitureOutputStateAfter)
									{
										case EnumFurnitureOutputState.NotStart:
											{
												//先计算剩余材料，剩余燃料，总共的产物，赋值给furniture对象

												furniture.Output_timeTicksStr = "";

											}
											break;
										case EnumFurnitureOutputState.Progressing:
											{
												//不做任何操作
											}
											break;
										case EnumFurnitureOutputState.PauseIn:
											{
												var beforeTicksList = furniture.Output_timeTicksStr.Split(new char[] { separatorChar }, StringSplitOptions.RemoveEmptyEntries).ToList();
												if (!beforeTicksList.Any())
												{
													beforeTicksList.Add(timeNow.Ticks.ToString());
												}
												beforeTicksList.Add(timeNow.Ticks.ToString());
												beforeTicksList = beforeTicksList.Distinct().ToList();
												furniture.Output_timeTicksStr = string.Join(separatorChar.ToString(), beforeTicksList.ToArray());
											}
											break;
										default:
											break;
									}
								}
								break;
							case EnumFurnitureOutputState.PauseIn:
								{
									switch (enumFurnitureOutputStateAfter)
									{
										case EnumFurnitureOutputState.NotStart:
											{
												//先计算剩余材料，剩余燃料，总共的产物，赋值给furniture对象

												furniture.Output_timeTicksStr = "";
											}
											break;
										case EnumFurnitureOutputState.Progressing:
											{
												var beforeTicksList = furniture.Output_timeTicksStr.Split(new char[] { separatorChar }, StringSplitOptions.RemoveEmptyEntries).ToList();
												if (!beforeTicksList.Any())
												{
													beforeTicksList.Add(timeNow.Ticks.ToString());
												}
												beforeTicksList.Add(timeNow.Ticks.ToString());
												beforeTicksList = beforeTicksList.Distinct().ToList();
												furniture.Output_timeTicksStr = string.Join(separatorChar.ToString(), beforeTicksList.ToArray());
											}
											break;
										case EnumFurnitureOutputState.PauseIn:
											{
												//不做任何操作
											}
											break;
										default:
											break;
									}
								}
								break;
							default:
								break;
						}

						FurnitureOutputInfo furnitureOutputInfo = null;
						var baseResp = furniture.GetFurnitureOutputInfo(session, out furnitureOutputInfo);
						if (baseResp.RespLevel != RespLevelEnum.Success)
						{
							session.Send(defCommand, req, baseResp);
							return;
						}

						//组装响应数据
						List<BackpackCellInfo> posGoodsinfoList = new List<BackpackCellInfo>();
						//获取影响的位置列表（只有两个，一个背包，一个家具）
						positionOptList.ForEach(optItem =>
						{
							if (MinecraftConfig.bpShortbarBelongsToTypeList.Any(m => m == optItem.enumGoodsBelongsToType))
							{
								//找到受影响的物品位置信息
								posGoodsinfoList.AddRange(session.minecraftSessionInfo.goodsList.Where(m => m.enumGoodsBelongsToType_Convert == optItem.enumGoodsBelongsToType && m.GoodsPosition == optItem.GoodsPosition && m.guid == optItem.guid).GetBackpackGoodsCellInfo());
								//if (posGoodsinfoList == null || !posGoodsinfoList.Any())
								//{
								//	posGoodsinfoList.Add(new BackpackCellInfo
								//	{
								//		enumGoodsBelongsToType = optItem.enumGoodsBelongsToType,
								//		GoodsList = new List<BackpackGoodsInfo>(),
								//		WastageValue = 0,
								//		GoodsPosition = optItem.GoodsPosition,
								//		GoodsItemId = ""
								//	});
								//}
							}
							else if (optItem.enumGoodsBelongsToType == EnumGoodsBelongsToType.FurnitureOutput)
							{
								//不作处理
							}
							else
							{
								//不作处理
							}
						});

						session.minecraftSessionInfo.goodsList.RemoveAll(m => m.Num <= 0);

						var resp = new FurnitureOutputGoodsMoveResp
						{
							posGoodsinfoList = posGoodsinfoList,
							furnitureOutputInfo = furnitureOutputInfo,
							point3 = furniture.point3,
							enumGoodsBelongsToTypeSource = req.enumGoodsBelongsToTypeSource,
							enumGoodsBelongsToTypeTarget = req.enumGoodsBelongsToTypeTarget,
							furnitureId = furniture.FurnitureId,
							level = furniture.Level,
							curHp = furniture.Hp
						};
						session.Send(defCommand, req, resp);
						#endregion
					}
					break;
				case EnumGoodsExchangeObjectType.FurnitureOutputUpgrade:
					{
						#region FurnitureOutputUpgrade
						defCommand = EnumCommand.Furniture_FurnitureOutputUpgradeGoodsMove;

						if (req.guid.IsNullOrWhiteSpace())
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误3：（原因：furnitureId参数为空）" });
							return;
						}

						//类型限制
						List<EnumGoodsBelongsToType> typeList = new List<EnumGoodsBelongsToType>()
						{
							EnumGoodsBelongsToType.ShortcutBar,
							EnumGoodsBelongsToType.Backpack,
							EnumGoodsBelongsToType.FurnitureOutputUpgrade,
						};
						if (!typeList.Any(m => m == req.enumGoodsBelongsToTypeSource))
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = $"错误5：（原因：传入的类型不在此范围【enumGoodsBelongsToTypeSource：{req.enumGoodsBelongsToTypeSource.ToString()}】）" });
							return;
						}
						if (!typeList.Any(m => m == req.enumGoodsBelongsToTypeTarget))
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = $"错误5：（原因：传入的类型不在此范围【enumGoodsBelongsToTypeTarget：{req.enumGoodsBelongsToTypeTarget.ToString()}】）" });
							return;
						}
						if (MinecraftConfig.bpShortbarBelongsToTypeList.Any(m => m == req.enumGoodsBelongsToTypeSource) && MinecraftConfig.bpShortbarBelongsToTypeList.Any(m => m == req.enumGoodsBelongsToTypeTarget))
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = $"错误5：（原因：两种类型不能同属于快捷栏或者背包）" });
							return;
						}
						//两种类型不能相同
						if (req.enumGoodsBelongsToTypeSource == req.enumGoodsBelongsToTypeTarget)
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误6：（原因：源物品类型和目标物品类型不能相同）" });
							return;
						}
						//获取产出家具信息
						var furniture = session.minecraftSessionInfo.furnitureOutputList.FirstOrDefault(m => m.FurnitureId == req.guid);
						if (furniture == null)
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误7：（原因：该产出家具信息不存在）" });
							return;
						}
						if (furniture.Hp <= 0)
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误8：（原因：家具 Hp <= 0）" });
							return;
						}
						Mod_Drawing mod_Furniture = furniture.GetMod_FurnitureInfo();
						if (mod_Furniture == null)
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误8：（原因：mod_Furniture 配置表不存在）" });
							return;
						}

						if (furniture.Level >= mod_Furniture.MaxLevel_Convert)
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误8：（原因：家具已经达到最大等级，不能再进行升级操作，所以不能调用该接口了）" });
							return;
						}

						//暂存操作之前的数据
						var beforeFurnitureInfo = furniture.DeepCopy();

						var baseRespSource = req.enumGoodsBelongsToTypeSource.GetFurnitureGoodsMovePosBelongsToTypeBaseType(req.guid, req.GoodsPositionSource, session, "BackpackGoodsExchange");
						if (baseRespSource.RespLevel != RespLevelEnum.Success)
						{
							session.Send(defCommand, req, baseRespSource);
							return;
						}
						var baseRespTarget = req.enumGoodsBelongsToTypeTarget.GetFurnitureGoodsMovePosBelongsToTypeBaseType(req.guid, req.GoodsPositionTarget, session, "BackpackGoodsExchange");
						if (baseRespTarget.RespLevel != RespLevelEnum.Success)
						{
							session.Send(defCommand, req, baseRespTarget);
							return;
						}
						//List<GoodsModel> transformGoodsList = new List<GoodsModel>();
						//添加操作影响的positionOptList
						List<BackpackGoodsPositionOpt> positionOptList = new List<BackpackGoodsPositionOpt>();
						//源位置是背包
						if (MinecraftConfig.bpShortbarBelongsToTypeList.Any(m => m == req.enumGoodsBelongsToTypeSource))
						{
							//背包数据（源位置）
							var backpackGoodsInfo = session.minecraftSessionInfo.goodsList.FirstOrDefault(m =>
								 m.enumGoodsBelongsToType_Convert == req.enumGoodsBelongsToTypeSource
								&& m.GoodsPosition == req.GoodsPositionSource && m.Num > 0);
							if (backpackGoodsInfo == null)
							{
								session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误8：（原因：源位置中的格子物品数量为空）" });
								return;
							}
							FurnitureOutputUpgradeMaterialInfo furnitureOutputUpgradeMaterialInfo = furniture.GetFurnitureOutputUpgradeMaterialGoodsInfoList_Convert().FirstOrDefault(m => m.position == req.GoodsPositionTarget);
							if (furnitureOutputUpgradeMaterialInfo.GoodsItemId == backpackGoodsInfo.GoodsItemId)
							{
								//if (furnitureOutputUpgradeMaterialInfo.Num <= 0)
								//{
								//	furnitureOutputUpgradeMaterialInfo.GoodsItemId = backpackGoodsInfo.GoodsItemId;
								//}

								var destGoodsItemMaxNum = furnitureOutputUpgradeMaterialInfo.needNum;
								if (furnitureOutputUpgradeMaterialInfo.Num >= destGoodsItemMaxNum)
								{
									session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = $"错误12：（原因：移动无效，交换相同物品时，会产生堆叠，如果目标位置已经满了，则无法操作【furnitureOutputUpgradeMaterialInfo.Num：{furnitureOutputUpgradeMaterialInfo.Num}，destGoodsItemMaxNum：{destGoodsItemMaxNum}】）" });
									return;
								}
								//判断目标位置还可以放多少个，才能放满
								var subValue = destGoodsItemMaxNum - furnitureOutputUpgradeMaterialInfo.Num;
								var canTakeNum = Math.Min(subValue, backpackGoodsInfo.Num);
								//var takeGoodsSourceList = backpackGoodsInfo.Take(subValue).ToList();
								backpackGoodsInfo.Num -= canTakeNum;
								//这里有Goods GUID 的消失
								//takeGoodsSourceList.ForEach(item =>
								//{
								//	session.minecraftSessionInfo.goodsList.RemoveAll(m => m.GoodsId == item.GoodsId);
								//});
								//transformGoodsList = takeGoodsSourceList;
								furnitureOutputUpgradeMaterialInfo.Num += canTakeNum;
								furniture.TransformListToOutput_UpgradeMaterialGoodsItemIdsPosAndNums_Convert(furnitureOutputUpgradeMaterialInfo);
							}
							else
							{
								session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误8：（原因：源位置与目标位置物品itemid不一致）" });
								return;
								////交换
								//backpackGoodsList.ForEach(item =>
								//{
								//	session.minecraftSessionInfo.goodsList.RemoveAll(m => m.GoodsId == item.GoodsId);
								//});
								////移动到背包
								//List<GoodsModel> transformGoodsList = new List<GoodsModel>();
								//for (int i = 0; i < furnitureOutputUpgradeMaterialInfo.Num; i++)
								//{
								//	transformGoodsList.Add(new GoodsModel()
								//	{
								//		BelongsTo = (int)req.enumGoodsBelongsToTypeSource,
								//		guid = "",
								//		GoodsId = StringHelper.GetGuidStr(),
								//		PlayerId = session.minecraftSessionInfo.player.PlayerId,
								//		GoodsPosition = req.GoodsPositionSource,
								//		GoodsItemId = furnitureOutputUpgradeMaterialInfo.GoodsItemId,
								//		WastageValue = 100
								//	});
								//}
								//session.minecraftSessionInfo.goodsList.AddRange(transformGoodsList);
								//furnitureOutputUpgradeMaterialInfo.GoodsItemId = backpackGoodsList.FirstOrDefault().GoodsItemId;
								//furnitureOutputUpgradeMaterialInfo.Num = backpackGoodsList.Count();
								//furniture.TransformListToOutput_UpgradeMaterialGoodsItemIdsPosAndNums_Convert(furnitureOutputUpgradeMaterialInfo);
							}

							//移动成功
							positionOptList.Add(new BackpackGoodsPositionOpt
							{
								enumGoodsBelongsToType = req.enumGoodsBelongsToTypeSource,
								GoodsPosition = req.GoodsPositionSource,
								guid = backpackGoodsInfo.guid
							});
							positionOptList.Add(new BackpackGoodsPositionOpt
							{
								enumGoodsBelongsToType = req.enumGoodsBelongsToTypeTarget,
								GoodsPosition = req.GoodsPositionTarget,
								guid = furniture.FurnitureId
							});
						}
						//源位置是产出家具（升级）
						else
						{
							FurnitureOutputUpgradeMaterialInfo furnitureOutputUpgradeMaterialInfo = furniture.GetFurnitureOutputUpgradeMaterialGoodsInfoList_Convert().FirstOrDefault(m => m.position == req.GoodsPositionSource);
							//背包数据（目标位置）
							var backpackGoodsInfo = session.minecraftSessionInfo.goodsList.FirstOrDefault(m =>
								 m.enumGoodsBelongsToType_Convert == req.enumGoodsBelongsToTypeTarget
								&& m.GoodsPosition == req.GoodsPositionTarget);
							//如果源位置与目标位置是相同物品，或者目标格子为空
							if (backpackGoodsInfo != null && backpackGoodsInfo.GoodsItemId == furnitureOutputUpgradeMaterialInfo.GoodsItemId
								|| (backpackGoodsInfo == null)
								)
							{
								if (backpackGoodsInfo == null)
								{
									backpackGoodsInfo = new GoodsModel()
									{
										BelongsTo = (int)req.enumGoodsBelongsToTypeTarget,
										GoodsId = StringHelper.GetGuidStr(),
										GoodsPosition = req.GoodsPositionTarget,
										GoodsItemId = furnitureOutputUpgradeMaterialInfo.GoodsItemId,
										Num = 0,
										guid = "",
										PlayerId = session.minecraftSessionInfo.player.PlayerId,
										WastageValue = 100
									};
									session.minecraftSessionInfo.goodsList.Add(backpackGoodsInfo);
								}
								//从配置中读取指定物品存放数量上限（由于源格子与目标格子的物品ItemId相同，所以可以选择源格子的物品ItemId）
								var destGoodsItemMaxNum = session.GetMaxCellNumConvert(furnitureOutputUpgradeMaterialInfo.GoodsItemId);
								//判断目标位置还可以放多少个，才能放满
								var subValue = destGoodsItemMaxNum - backpackGoodsInfo.Num;
								//得到可以移动的个数
								var canMoveNum = Math.Min(subValue, furnitureOutputUpgradeMaterialInfo.Num);

								//此处有新的goods GUID 产生
								//for (int canMoveIndex = 0; canMoveIndex < canMoveNum; canMoveIndex++)
								//{
								//	transformGoodsList.Add(new GoodsModel
								//	{
								//		BelongsTo = (int)req.enumGoodsBelongsToTypeTarget,
								//		GoodsId = StringHelper.GetGuidStr(),
								//		GoodsItemId = furnitureOutputUpgradeMaterialInfo.GoodsItemId,
								//		GoodsPosition = req.GoodsPositionTarget,
								//		PlayerId = session.minecraftSessionInfo.player.PlayerId,
								//		WastageValue = 100,
								//		guid = "",
								//	});
								//}
								////更新目标格子的物品
								//session.minecraftSessionInfo.goodsList.AddRange(transformGoodsList);

								backpackGoodsInfo.Num += canMoveNum;

								furnitureOutputUpgradeMaterialInfo.Num -= canMoveNum;
								furniture.TransformListToOutput_UpgradeMaterialGoodsItemIdsPosAndNums_Convert(furnitureOutputUpgradeMaterialInfo);
							}
							else
							{
								session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误8：（原因：源位置与目标位置物品itemid不一致）" });
								return;
								////交换
								//backpackGoodsList.ForEach(item =>
								//{
								//	session.minecraftSessionInfo.goodsList.RemoveAll(m => m.GoodsId == item.GoodsId);
								//});
								////此处有新的goods GUID 产生
								//List<GoodsModel> transformGoodsList = new List<GoodsModel>();
								//for (int i = 0; i < furnitureOutputUpgradeMaterialInfo.Num; i++)
								//{
								//	GoodsModel goodsModel = new GoodsModel
								//	{
								//		BelongsTo = (int)req.enumGoodsBelongsToTypeTarget,
								//		GoodsId = StringHelper.GetGuidStr(),
								//		GoodsItemId = furnitureOutputUpgradeMaterialInfo.GoodsItemId,
								//		GoodsPosition = req.GoodsPositionTarget,
								//		PlayerId = session.minecraftSessionInfo.player.PlayerId,
								//		WastageValue = 100,
								//		guid = "",
								//	};
								//	transformGoodsList.Add(goodsModel);
								//}
								////更新目标格子的物品
								//session.minecraftSessionInfo.goodsList.AddRange(transformGoodsList);

								//furnitureOutputUpgradeMaterialInfo.GoodsItemId = backpackGoodsList.FirstOrDefault().GoodsItemId;
								//furnitureOutputUpgradeMaterialInfo.Num = backpackGoodsList.Count();
								//furniture.TransformListToOutput_UpgradeMaterialGoodsItemIdsPosAndNums_Convert(furnitureOutputUpgradeMaterialInfo);
							}
							//移动成功
							positionOptList.Add(new BackpackGoodsPositionOpt
							{
								enumGoodsBelongsToType = req.enumGoodsBelongsToTypeSource,
								GoodsPosition = req.GoodsPositionSource
							});
							positionOptList.Add(new BackpackGoodsPositionOpt
							{
								enumGoodsBelongsToType = req.enumGoodsBelongsToTypeTarget,
								GoodsPosition = req.GoodsPositionTarget
							});
						}

						//组装响应数据
						List<BackpackCellInfo> posGoodsinfoList = new List<BackpackCellInfo>();
						List<FurnitureOutputUpgradeMaterialInfo> furnitureOutputUpgradeMaterialInfoList = new List<FurnitureOutputUpgradeMaterialInfo>();
						//获取影响的位置列表（只有两个，一个背包，一个家具）
						positionOptList.ForEach(optItem =>
						{
							if (MinecraftConfig.bpShortbarBelongsToTypeList.Any(m => m == optItem.enumGoodsBelongsToType))
							{
								//找到受影响的物品位置信息
								posGoodsinfoList.AddRange(session.minecraftSessionInfo.goodsList.Where(m => m.enumGoodsBelongsToType_Convert == optItem.enumGoodsBelongsToType && m.GoodsPosition == optItem.GoodsPosition).GetBackpackGoodsCellInfo());
								//if (posGoodsinfoList == null || !posGoodsinfoList.Any())
								//{
								//	posGoodsinfoList.Add(new BackpackCellInfo
								//	{
								//		enumGoodsBelongsToType = optItem.enumGoodsBelongsToType,
								//		GoodsList = new List<BackpackGoodsInfo>(),
								//		WastageValue = 0,
								//		GoodsPosition = optItem.GoodsPosition,
								//		GoodsItemId = ""
								//	});
								//}
							}
							else if (optItem.enumGoodsBelongsToType == EnumGoodsBelongsToType.FurnitureOutputUpgrade)
							{
								furnitureOutputUpgradeMaterialInfoList = furniture.GetFurnitureOutputUpgradeMaterialGoodsInfoList_Convert().Where(m => m.position == optItem.GoodsPosition).ToList();
								//foreach (var item in furnitureOutputUpgradeMaterialInfoList)
								//{
								//	posGoodsinfoList.Add(new BackpackCellInfo
								//	{
								//		enumGoodsBelongsToType = optItem.enumGoodsBelongsToType,
								//		GodsId = "",
								//		GoodsItemId = item.GoodsItemId,
								//		GoodsPosition = item.position,
								//		Num = item.Num,
								//		WastageValue = 100,
								//		guid = optItem.guid
								//	});
								//}
							}
							else
							{
								//不作处理
							}
						});

						FurnitureOutputUpgradeInfo furnitureOutputUpgradeInfo = furniture.GetFurnitureOutputUpgradeInfo(session);

						session.minecraftSessionInfo.goodsList.RemoveAll(m => m.Num <= 0);

						var resp = new FurnitureOutputUpgradeGoodsMoveResp
						{
							furnitureId = furniture.FurnitureId,
							furnitureLevel = furniture.Level,
							enumGoodsBelongsToTypeSource = req.enumGoodsBelongsToTypeSource,
							enumGoodsBelongsToTypeTarget = req.enumGoodsBelongsToTypeTarget,
							posGoodsinfoList = posGoodsinfoList,
							furnitureOutputUpgradeMaterialInfoList = furnitureOutputUpgradeMaterialInfoList,
							curHp = furniture.Hp,
							furnitureOutputUpgradeInfo = furnitureOutputUpgradeInfo
						};
						session.Send(defCommand, req, resp);
						#endregion
					}
					break;
				case EnumGoodsExchangeObjectType.FurnitureOutputRepair:
					{
						#region FurnitureOutputRepair
						defCommand = EnumCommand.Furniture_FurnitureOutputRepairGoodsMove;

						if (req.guid.IsNullOrWhiteSpace())
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误3：（原因：furnitureId参数为空）" });
							return;
						}

						//类型限制
						List<EnumGoodsBelongsToType> typeList = new List<EnumGoodsBelongsToType>()
						{
							EnumGoodsBelongsToType.ShortcutBar,
							EnumGoodsBelongsToType.Backpack,
							EnumGoodsBelongsToType.FurnitureOutputRepair,
						};
						if (!typeList.Any(m => m == req.enumGoodsBelongsToTypeSource))
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = $"错误5：（原因：传入的类型不在此范围【enumGoodsBelongsToTypeSource：{req.enumGoodsBelongsToTypeSource.ToString()}】）" });
							return;
						}
						if (!typeList.Any(m => m == req.enumGoodsBelongsToTypeTarget))
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = $"错误5：（原因：传入的类型不在此范围【enumGoodsBelongsToTypeTarget：{req.enumGoodsBelongsToTypeTarget.ToString()}】）" });
							return;
						}
						if (MinecraftConfig.bpShortbarBelongsToTypeList.Any(m => m == req.enumGoodsBelongsToTypeSource) && MinecraftConfig.bpShortbarBelongsToTypeList.Any(m => m == req.enumGoodsBelongsToTypeTarget))
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = $"错误5：（原因：两种类型不能同属于快捷栏或者背包）" });
							return;
						}
						//两种类型不能相同
						if (req.enumGoodsBelongsToTypeSource == req.enumGoodsBelongsToTypeTarget)
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误6：（原因：源物品类型和目标物品类型不能相同）" });
							return;
						}
						//获取产出家具信息
						var furniture = session.minecraftSessionInfo.furnitureOutputList.FirstOrDefault(m => m.FurnitureId == req.guid);
						if (furniture == null)
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误7：（原因：该产出家具信息不存在）" });
							return;
						}
						Mod_Drawing mod_Furniture = furniture.GetMod_FurnitureInfo();
						if (mod_Furniture == null)
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误8：（原因：mod_Furniture 配置表不存在）" });
							return;
						}

						if (furniture.Hp > 0)
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误8：（原因：家具 Hp > 0，不能进行修理操作，所以不能调用该接口）" });
							return;
						}

						//暂存操作之前的数据
						var beforeFurnitureInfo = furniture.DeepCopy();

						var baseRespSource = req.enumGoodsBelongsToTypeSource.GetFurnitureGoodsMovePosBelongsToTypeBaseType(req.guid, req.GoodsPositionSource, session, "BackpackGoodsExchange");
						if (baseRespSource.RespLevel != RespLevelEnum.Success)
						{
							session.Send(defCommand, req, baseRespSource);
							return;
						}
						var baseRespTarget = req.enumGoodsBelongsToTypeTarget.GetFurnitureGoodsMovePosBelongsToTypeBaseType(req.guid, req.GoodsPositionTarget, session, "BackpackGoodsExchange");
						if (baseRespTarget.RespLevel != RespLevelEnum.Success)
						{
							session.Send(defCommand, req, baseRespTarget);
							return;
						}
						//List<GoodsModel> transformGoodsList = new List<GoodsModel>();
						//添加操作影响的positionOptList
						List<BackpackGoodsPositionOpt> positionOptList = new List<BackpackGoodsPositionOpt>();
						//源位置是背包
						if (MinecraftConfig.bpShortbarBelongsToTypeList.Any(m => m == req.enumGoodsBelongsToTypeSource))
						{
							//背包数据（源位置）
							var backpackGoodsInfo = session.minecraftSessionInfo.goodsList.FirstOrDefault(m =>
								 m.enumGoodsBelongsToType_Convert == req.enumGoodsBelongsToTypeSource
								&& m.GoodsPosition == req.GoodsPositionSource && m.Num > 0);
							if (backpackGoodsInfo == null)
							{
								session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误8：（原因：源位置中的格子物品数量为空）" });
								return;
							}
							FurnitureOutputRepairMaterialInfo furnitureOutputRepairMaterialInfo = furniture.GetFurnitureOutputRepairMaterialGoodsInfoList_Convert().FirstOrDefault(m => m.position == req.GoodsPositionTarget);
							if (furnitureOutputRepairMaterialInfo.GoodsItemId == backpackGoodsInfo.GoodsItemId)
							{
								var destGoodsItemMaxNum = furnitureOutputRepairMaterialInfo.needNum;
								if (furnitureOutputRepairMaterialInfo.Num >= destGoodsItemMaxNum)
								{
									session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = $"错误12：（原因：移动无效，交换相同物品时，会产生堆叠，如果目标位置已经满了，则无法操作【furnitureOutputRepairMaterialInfo.Num：{furnitureOutputRepairMaterialInfo.Num}，destGoodsItemMaxNum：{destGoodsItemMaxNum}】）" });
									return;
								}
								//判断目标位置还可以放多少个，才能放满
								var subValue = destGoodsItemMaxNum - furnitureOutputRepairMaterialInfo.Num;
								var canTakeNum = Math.Min(subValue, backpackGoodsInfo.Num);
								//var takeGoodsSourceList = backpackGoodsInfo.Take(subValue).ToList();
								backpackGoodsInfo.Num -= canTakeNum;
								//这里有Goods GUID 的消失
								//takeGoodsSourceList.ForEach(item =>
								//{
								//	session.minecraftSessionInfo.goodsList.RemoveAll(m => m.GoodsId == item.GoodsId);
								//});
								//transformGoodsList = takeGoodsSourceList;
								furnitureOutputRepairMaterialInfo.Num += canTakeNum;
								furniture.TransformListToOutput_RepairMaterialGoodsItemIdsPosAndNums_Convert(furnitureOutputRepairMaterialInfo);
							}
							else
							{
								session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误8：（原因：源位置与目标位置物品itemid不一致）" });
								return;
								////交换
								//backpackGoodsList.ForEach(item =>
								//{
								//	session.minecraftSessionInfo.goodsList.RemoveAll(m => m.GoodsId == item.GoodsId);
								//});
								////移动到背包
								//List<GoodsModel> transformGoodsList = new List<GoodsModel>();
								//for (int i = 0; i < furnitureOutputRepairMaterialInfo.Num; i++)
								//{
								//	transformGoodsList.Add(new GoodsModel()
								//	{
								//		BelongsTo = (int)req.enumGoodsBelongsToTypeSource,
								//		guid = "",
								//		GoodsId = StringHelper.GetGuidStr(),
								//		PlayerId = session.minecraftSessionInfo.player.PlayerId,
								//		GoodsPosition = req.GoodsPositionSource,
								//		GoodsItemId = furnitureOutputRepairMaterialInfo.GoodsItemId,
								//		WastageValue = 100
								//	});
								//}
								//session.minecraftSessionInfo.goodsList.AddRange(transformGoodsList);
								//furnitureOutputRepairMaterialInfo.GoodsItemId = backpackGoodsList.FirstOrDefault().GoodsItemId;
								//furnitureOutputRepairMaterialInfo.Num = backpackGoodsList.Count();
								//furniture.TransformListToOutput_RepairMaterialGoodsItemIdsPosAndNums_Convert(furnitureOutputRepairMaterialInfo);
							}

							//移动成功
							positionOptList.Add(new BackpackGoodsPositionOpt
							{
								enumGoodsBelongsToType = req.enumGoodsBelongsToTypeSource,
								GoodsPosition = req.GoodsPositionSource,
								guid = backpackGoodsInfo.guid
							});
							positionOptList.Add(new BackpackGoodsPositionOpt
							{
								enumGoodsBelongsToType = req.enumGoodsBelongsToTypeTarget,
								GoodsPosition = req.GoodsPositionTarget,
								guid = furniture.FurnitureId
							});
						}
						//源位置是产出家具（修理）
						else
						{
							FurnitureOutputRepairMaterialInfo furnitureOutputRepairMaterialInfo = furniture.GetFurnitureOutputRepairMaterialGoodsInfoList_Convert().FirstOrDefault(m => m.position == req.GoodsPositionSource);
							//背包数据（目标位置）
							var backpackGoodsInfo = session.minecraftSessionInfo.goodsList.FirstOrDefault(m =>
								 m.enumGoodsBelongsToType_Convert == req.enumGoodsBelongsToTypeTarget
								&& m.GoodsPosition == req.GoodsPositionTarget);
							//如果源位置与目标位置是相同物品，或者目标格子为空
							if (backpackGoodsInfo != null && backpackGoodsInfo.GoodsItemId == furnitureOutputRepairMaterialInfo.GoodsItemId
								|| (backpackGoodsInfo == null)
								)
							{
								if (backpackGoodsInfo == null)
								{
									backpackGoodsInfo = new GoodsModel()
									{
										BelongsTo = (int)req.enumGoodsBelongsToTypeTarget,
										GoodsId = StringHelper.GetGuidStr(),
										GoodsPosition = req.GoodsPositionTarget,
										GoodsItemId = furnitureOutputRepairMaterialInfo.GoodsItemId,
										Num = 0,
										guid = "",
										PlayerId = session.minecraftSessionInfo.player.PlayerId,
										WastageValue = 100
									};
									session.minecraftSessionInfo.goodsList.Add(backpackGoodsInfo);
								}
								//从配置中读取指定物品存放数量上限（由于源格子与目标格子的物品ItemId相同，所以可以选择源格子的物品ItemId）
								var destGoodsItemMaxNum = session.GetMaxCellNumConvert(furnitureOutputRepairMaterialInfo.GoodsItemId);
								//判断目标位置还可以放多少个，才能放满
								var subValue = destGoodsItemMaxNum - backpackGoodsInfo.Num;
								//得到可以移动的个数
								var canMoveNum = Math.Min(subValue, furnitureOutputRepairMaterialInfo.Num);

								//此处有新的goods GUID 产生
								//for (int canMoveIndex = 0; canMoveIndex < canMoveNum; canMoveIndex++)
								//{
								//	transformGoodsList.Add(new GoodsModel
								//	{
								//		BelongsTo = (int)req.enumGoodsBelongsToTypeTarget,
								//		GoodsId = StringHelper.GetGuidStr(),
								//		GoodsItemId = furnitureOutputRepairMaterialInfo.GoodsItemId,
								//		GoodsPosition = req.GoodsPositionTarget,
								//		PlayerId = session.minecraftSessionInfo.player.PlayerId,
								//		WastageValue = 100,
								//		guid = "",
								//	});
								//}
								////更新目标格子的物品
								//session.minecraftSessionInfo.goodsList.AddRange(transformGoodsList);

								backpackGoodsInfo.Num += canMoveNum;

								furnitureOutputRepairMaterialInfo.Num -= canMoveNum;
								furniture.TransformListToOutput_RepairMaterialGoodsItemIdsPosAndNums_Convert(furnitureOutputRepairMaterialInfo);
							}
							else
							{
								session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误8：（原因：源位置与目标位置物品itemid不一致）" });
								return;
								////交换
								//backpackGoodsList.ForEach(item =>
								//{
								//	session.minecraftSessionInfo.goodsList.RemoveAll(m => m.GoodsId == item.GoodsId);
								//});
								////此处有新的goods GUID 产生
								//List<GoodsModel> transformGoodsList = new List<GoodsModel>();
								//for (int i = 0; i < furnitureOutputRepairMaterialInfo.Num; i++)
								//{
								//	GoodsModel goodsModel = new GoodsModel
								//	{
								//		BelongsTo = (int)req.enumGoodsBelongsToTypeTarget,
								//		GoodsId = StringHelper.GetGuidStr(),
								//		GoodsItemId = furnitureOutputRepairMaterialInfo.GoodsItemId,
								//		GoodsPosition = req.GoodsPositionTarget,
								//		PlayerId = session.minecraftSessionInfo.player.PlayerId,
								//		WastageValue = 100,
								//		guid = "",
								//	};
								//	transformGoodsList.Add(goodsModel);
								//}
								////更新目标格子的物品
								//session.minecraftSessionInfo.goodsList.AddRange(transformGoodsList);

								//furnitureOutputRepairMaterialInfo.GoodsItemId = backpackGoodsList.FirstOrDefault().GoodsItemId;
								//furnitureOutputRepairMaterialInfo.Num = backpackGoodsList.Count();
								//furniture.TransformListToOutput_RepairMaterialGoodsItemIdsPosAndNums_Convert(furnitureOutputRepairMaterialInfo);
							}
							//移动成功
							positionOptList.Add(new BackpackGoodsPositionOpt
							{
								enumGoodsBelongsToType = req.enumGoodsBelongsToTypeSource,
								GoodsPosition = req.GoodsPositionSource
							});
							positionOptList.Add(new BackpackGoodsPositionOpt
							{
								enumGoodsBelongsToType = req.enumGoodsBelongsToTypeTarget,
								GoodsPosition = req.GoodsPositionTarget
							});
						}

						//组装响应数据
						List<BackpackCellInfo> posGoodsinfoList = new List<BackpackCellInfo>();
						List<FurnitureOutputRepairMaterialInfo> furnitureOutputRepairMaterialInfoList = new List<FurnitureOutputRepairMaterialInfo>();
						//获取影响的位置列表（只有两个，一个背包，一个家具）
						positionOptList.ForEach(optItem =>
						{
							if (MinecraftConfig.bpShortbarBelongsToTypeList.Any(m => m == optItem.enumGoodsBelongsToType))
							{
								//找到受影响的物品位置信息
								posGoodsinfoList.AddRange(session.minecraftSessionInfo.goodsList.Where(m => m.enumGoodsBelongsToType_Convert == optItem.enumGoodsBelongsToType && m.GoodsPosition == optItem.GoodsPosition).GetBackpackGoodsCellInfo());
								//if (posGoodsinfoList == null || !posGoodsinfoList.Any())
								//{
								//	posGoodsinfoList.Add(new BackpackCellInfo
								//	{
								//		enumGoodsBelongsToType = optItem.enumGoodsBelongsToType,
								//		GoodsList = new List<BackpackGoodsInfo>(),
								//		WastageValue = 0,
								//		GoodsPosition = optItem.GoodsPosition,
								//		GoodsItemId = ""
								//	});
								//}
							}
							else if (optItem.enumGoodsBelongsToType == EnumGoodsBelongsToType.FurnitureOutputRepair)
							{
								furnitureOutputRepairMaterialInfoList = furniture.GetFurnitureOutputRepairMaterialGoodsInfoList_Convert().Where(m => m.position == optItem.GoodsPosition).ToList();
							}
							else
							{
								//不作处理
							}
						});

						session.minecraftSessionInfo.goodsList.RemoveAll(m => m.Num <= 0);

						var resp = new FurnitureOutputRepairGoodsMoveResp
						{
							furnitureId = furniture.FurnitureId,
							furnitureLevel = furniture.Level,
							enumGoodsBelongsToTypeSource = req.enumGoodsBelongsToTypeSource,
							enumGoodsBelongsToTypeTarget = req.enumGoodsBelongsToTypeTarget,
							posGoodsinfoList = posGoodsinfoList,
							furnitureOutputRepairMaterialInfoList = furnitureOutputRepairMaterialInfoList,
							curHp = furniture.Hp
						};
						session.Send(defCommand, req, resp);
						#endregion
					}
					break;
				case EnumGoodsExchangeObjectType.Other:
					{
						#region Other
						defCommand = EnumCommand.Backpack_BackpackGoodsExchange;

						//物品来源判断
						if (!MinecraftConfig.enumGoodsSourceBelongsToTypeList.Any(m => m == req.enumGoodsBelongsToTypeSource))
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = $"错误1：（原因：物品来源不正确，前端传入的物品来源为【{req.enumGoodsBelongsToTypeSource.ToString()}】）" });
							return;
						}
						//物品目的地判断
						if (!MinecraftConfig.enumGoodsSourceBelongsToTypeList.Any(m => m == req.enumGoodsBelongsToTypeTarget))
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = $"错误1：（原因：物品目的地不正确，前端传入的物品目的地为【{req.enumGoodsBelongsToTypeTarget.ToString()}】）" });
							return;
						}
						if (req.guid.IsNullOrWhiteSpace())
						{
							req.guid = "";
						}

						if (req.enumGoodsBelongsToTypeSource == req.enumGoodsBelongsToTypeTarget && req.GoodsPositionSource == req.GoodsPositionTarget)
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = $"错误3：（原因：源位置与目标位置相同【类型：{req.enumGoodsBelongsToTypeSource.ToString()}，位置：{req.GoodsPositionSource}】）" });
							return;
						}
						var baseRespSource = req.enumGoodsBelongsToTypeSource.GetBackpackGoodsBelongsToTypeBaseType(req.GoodsPositionSource, session, "BackpackGoodsExchange", req.guid);
						if (baseRespSource.RespLevel != RespLevelEnum.Success)
						{
							session.Send(defCommand, req, baseRespSource);
							return;
						}
						var baseRespDestination = req.enumGoodsBelongsToTypeTarget.GetBackpackGoodsBelongsToTypeBaseType(req.GoodsPositionTarget, session, "BackpackGoodsExchange", req.guid);
						if (baseRespDestination.RespLevel != RespLevelEnum.Success)
						{
							session.Send(defCommand, req, baseRespDestination);
							return;
						}
						bool isFurniture = baseRespSource.isFurniture || baseRespDestination.isFurniture;
						//物品所属类型判断对guid赋值
						string guidSource = req.guid;
						string guidDestination = req.guid;
						if (MinecraftConfig.bpShortbarBelongsToTypeList.Any(m => m == req.enumGoodsBelongsToTypeSource))
						{
							guidSource = "";
						}
						if (MinecraftConfig.bpShortbarBelongsToTypeList.Any(m => m == req.enumGoodsBelongsToTypeTarget))
						{
							guidDestination = "";
						}
						Func<GoodsModel, bool> predicateSource = m => m.enumGoodsBelongsToType_Convert == req.enumGoodsBelongsToTypeSource && m.GoodsPosition == req.GoodsPositionSource && m.Num > 0 && m.guid == guidSource;
						Func<GoodsModel, bool> predicateDestination = m => m.enumGoodsBelongsToType_Convert == req.enumGoodsBelongsToTypeTarget && m.GoodsPosition == req.GoodsPositionTarget && m.guid == guidDestination;

						var goodsSourceInfo = session.minecraftSessionInfo.goodsList.FirstOrDefault(predicateSource);
						var goodsDestinationInfo = session.minecraftSessionInfo.goodsList.FirstOrDefault(predicateDestination);
						if (goodsSourceInfo == null)
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误4：（原因：源物品交换格子不能为空）" });
							return;
						}

						//添加操作影响的positionOptList
						List<BackpackGoodsPositionOpt> positionOptList = new List<BackpackGoodsPositionOpt>();
						positionOptList.Add(new BackpackGoodsPositionOpt
						{
							enumGoodsBelongsToType = req.enumGoodsBelongsToTypeSource,
							GoodsPosition = req.GoodsPositionSource,
							guid = guidSource
						});
						positionOptList.Add(new BackpackGoodsPositionOpt
						{
							enumGoodsBelongsToType = req.enumGoodsBelongsToTypeTarget,
							GoodsPosition = req.GoodsPositionTarget,
							guid = guidDestination
						});

						//交换操作，更新内存
						//如果源位置与目标位置是相同物品
						if (goodsDestinationInfo != null && goodsSourceInfo.GoodsItemId == goodsDestinationInfo.GoodsItemId)
						{
							//相同的goodsItem可以叠加到一起
							//从配置中读取指定物品存放数量上限
							var destGoodsItemMaxNum = session.GetMaxCellNumConvert(goodsDestinationInfo.GoodsItemId);

							//判断目标位置还可以放多少个，才能放满
							var subValue = destGoodsItemMaxNum - goodsDestinationInfo.Num;
							var canTakeNum = Math.Min(subValue, goodsSourceInfo.Num);
							goodsSourceInfo.Num -= canTakeNum;
							goodsDestinationInfo.Num += canTakeNum;
						}
						//如果源位置与目标位置是不同物品，或者目标位置为空
						else
						{
							//如果操作的两个格子中的物品goodsItem不同（目标格子可以为空）
							var sourceCopy = goodsSourceInfo.DeepCopy();
							if (goodsDestinationInfo != null)
							{
								var destinationCopy = goodsDestinationInfo.DeepCopy();

								goodsSourceInfo.BelongsTo = destinationCopy.BelongsTo;
								//goodsSourceInfo.GoodsId = destinationCopy.GoodsId;
								//goodsSourceInfo.GoodsItemId = destinationCopy.GoodsItemId;
								goodsSourceInfo.GoodsPosition = destinationCopy.GoodsPosition;
								goodsSourceInfo.guid = destinationCopy.guid;
								//goodsSourceInfo.Num = destinationCopy.Num;
								//goodsSourceInfo.PlayerId = destinationCopy.PlayerId;
								//goodsSourceInfo.WastageValue = destinationCopy.WastageValue;

								goodsDestinationInfo.BelongsTo = sourceCopy.BelongsTo;
								//goodsDestinationInfo.GoodsId = sourceCopy.GoodsId;
								//goodsDestinationInfo.GoodsItemId = sourceCopy.GoodsItemId;
								goodsDestinationInfo.GoodsPosition = sourceCopy.GoodsPosition;
								goodsDestinationInfo.guid = sourceCopy.guid;
								//goodsDestinationInfo.Num = sourceCopy.Num;
								//goodsDestinationInfo.PlayerId = sourceCopy.PlayerId;
								//goodsDestinationInfo.WastageValue = sourceCopy.WastageValue;

							}
							else
							{
								goodsSourceInfo.Num = 0;
								goodsDestinationInfo = new GoodsModel
								{
									BelongsTo = (int)req.enumGoodsBelongsToTypeTarget,
									GoodsId = StringHelper.GetGuidStr(),
									GoodsItemId = sourceCopy.GoodsItemId,
									GoodsPosition = req.GoodsPositionTarget,
									guid = guidDestination,
									Num = sourceCopy.Num,
									PlayerId = session.minecraftSessionInfo.player.PlayerId,
									WastageValue = sourceCopy.WastageValue,
								};
								session.minecraftSessionInfo.goodsList.Add(goodsDestinationInfo);
							}

						}

						//获取响应数据
						//找到受影响的物品位置信息
						Func<GoodsModel, bool> predicateBeAffected = m =>
							positionOptList.Any(n => n.enumGoodsBelongsToType == m.enumGoodsBelongsToType_Convert
							&& n.GoodsPosition == m.GoodsPosition && m.guid == n.guid);
						//交换操作结束后受影响的两个位置的最终物品列表信息（如果在交换之前，目标位置为空，则元素只有一个（一定为受影响后的目标位置的物品信息），如果都不为空，则列表对象有两个）
						var posGoodsinfoList = session.minecraftSessionInfo.goodsList.Where(predicateBeAffected).GetBackpackGoodsCellInfo();

						session.minecraftSessionInfo.goodsList.RemoveAll(m => m.Num <= 0);

						var resp = new BackpackGoodsExchangeResp
						{
							backpackShortcutBarCellInfoList = posGoodsinfoList,
							enumGoodsBelongsToTypeSource = req.enumGoodsBelongsToTypeSource,
							enumGoodsBelongsToTypeDestination = req.enumGoodsBelongsToTypeTarget,
							guid = req.guid,
							entityId = req.entityId,
							isFurniture = isFurniture
						};
						session.Send(defCommand, req, resp);
						#endregion
					}
					break;
				case EnumGoodsExchangeObjectType.EquipmentSattireIn:
					{
						#region EquipmentSattireIn
						defCommand = EnumCommand.Equipment_EquipmentGoodsSattireIn;

						//if (JsonConfig.Value.IsDebug)
						//{
						//	req = new EquipmentGoodsSattireInReq
						//	{
						//		enumEquipmentGoodsBelongsToType = EnumGoodsBelongsToType.SurvivorEquipment,
						//		enumGoodsBelongsToType = EnumGoodsBelongsToType.Backpack,
						//		goodsId = (from info in session.minecraftSessionInfo.goodsList
						//				   where (info.enumGoodsBelongsToType_Convert == EnumGoodsBelongsToType.ShortcutBar || info.enumGoodsBelongsToType_Convert == EnumGoodsBelongsToType.Backpack)
						//				   && info.GoodsItemId == "120000"
						//				   select info).ToList().FirstOrDefault().GoodsId,
						//		guid = ""
						//	};
						//}

						//物品来源判断
						if (!MinecraftConfig.bpShortbarBelongsToTypeList.Any(m => m == req.enumGoodsBelongsToTypeSource))
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = $"错误1：（原因：物品来源不正确，前端传入的物品来源为【{req.enumGoodsBelongsToTypeSource.ToString()}】）" });
							return;
						}
						//装备类型判断
						if (!MinecraftConfig.equipmentBelongsToTypeList.Any(m => m == req.enumGoodsBelongsToTypeTarget))
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = $"错误1：（原因：装备类型不正确，前端传入的装备类型为【{req.enumGoodsBelongsToTypeSource.ToString()}】）" });
							return;
						}

						if (req.guid.IsNullOrWhiteSpace())
						{
							req.guid = "";
						}

						////暂时写死
						//if (req.enumGoodsBelongsToTypeTarget == EnumGoodsBelongsToType.SurvivorEquipment)
						//{
						//	req.guid = session.minecraftSessionInfo.survivorList.FirstOrDefault(m => m.PlayerId == session.minecraftSessionInfo.player.PlayerId).SurvivorId;
						//}

						//if (req.goodsId.IsNullOrWhiteSpace())
						//{
						//	session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误1：（原因：goodsId参数不能为空）" });
						//	return;
						//}

						var goodsBelongsTypeList = new List<EnumGoodsBelongsToType>();
						if (MinecraftConfig.bpShortbarBelongsToTypeList.Any(m => m == req.enumGoodsBelongsToTypeSource))
						{
							goodsBelongsTypeList = MinecraftConfig.bpShortbarBelongsToTypeList;
						}
						else
						{
							goodsBelongsTypeList = new List<EnumGoodsBelongsToType>() { req.enumGoodsBelongsToTypeSource };
						}

						var goodsInfo = session.minecraftSessionInfo.goodsList.FirstOrDefault(m =>
							m.enumGoodsBelongsToType_Convert == req.enumGoodsBelongsToTypeSource
							&& m.GoodsPosition == req.GoodsPositionSource);
						if (goodsInfo == null)
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = $"错误1：（原因：该物品不存在于【{goodsBelongsTypeList.JsonSerialize()}】中，或者根本就不存在）" });
							return;
						}

						//var mod_Items = CsvConfig.itemsList.FirstOrDefault(m => m.Id == goodsInfo.GoodsItemId);
						var mod_Items = CsvConfig.GetMod_ItemsInfoById(goodsInfo.GoodsItemId);
						if (mod_Items == null)
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误1：（原因：物品配置表中不存在）" });
							return;
						}
						var equipmentTypeList = new List<EnumGoodsType>()
						{
							EnumGoodsType.Equipment,
							EnumGoodsType.Weapon
						};
						if (!equipmentTypeList.Any(m => m == mod_Items.enumGoodsType_Convert))
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = $"错误1：（原因：该物品类型不支持，目前该物品类型为【{mod_Items.enumGoodsType_Convert.ToString()}】）" });
							return;
						}
						//Mod_Player_Parts mod_Player_Parts = CsvConfig.player_partsList.FirstOrDefault(m => m.ID == goodsInfo.GoodsItemId);
						Mod_Player_Parts mod_Player_Parts = CsvConfig.GetMod_Player_PartsInfoById(goodsInfo.GoodsItemId);
						if (mod_Player_Parts == null)
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误1：（原因：装备配置表中不存在该物品）" });
							return;
						}

						var equipment = session.minecraftSessionInfo.goodsList.FirstOrDefault(m =>
							m.enumGoodsBelongsToType_Convert == req.enumGoodsBelongsToTypeTarget && m.guid == req.guid
							&& m.GoodsItemId == goodsInfo.GoodsItemId
							&& m.GoodsPosition == mod_Player_Parts.Position_Convert);

						if (equipment != null)
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误1：（原因：该装备不能重复穿戴）" });
							return;
						}

						goodsInfo.Num--;

						//session.minecraftSessionInfo.goodsList.RemoveAll(m => m.GoodsId == goodsInfo.GoodsId);

						session.minecraftSessionInfo.goodsList.Add(new GoodsModel
						{
							BelongsTo = (int)req.enumGoodsBelongsToTypeTarget,
							GoodsId = StringHelper.GetGuidStr(),
							PlayerId = session.minecraftSessionInfo.player.PlayerId,
							WastageValue = goodsInfo.WastageValue,
							GoodsItemId = goodsInfo.GoodsItemId,
							GoodsPosition = mod_Player_Parts.Position_Convert,
							guid = req.guid,
							Num = 1,
						});

						EnumAttribute enumAttribute = mod_Items.modAttributeInfo_Convert.enumAttribute;
						int attributeAfterVal = 0;
						switch (mod_Items.modAttributeInfo_Convert.enumAttribute)
						{
							case EnumAttribute.Def:
								{
									switch (req.enumGoodsBelongsToTypeTarget)
									{

										case EnumGoodsBelongsToType.Equipment:
											{
												session.minecraftSessionInfo.player.Fight_Defense += mod_Items.modAttributeInfo_Convert.Value;
												attributeAfterVal = session.minecraftSessionInfo.player.Fight_Defense;
											}
											break;
										case EnumGoodsBelongsToType.SurvivorEquipment:
											{
												//幸存者装备
											}
											break;
										default:
											break;
									}


								}
								break;
							case EnumAttribute.BagSize:
								{
									switch (req.enumGoodsBelongsToTypeTarget)
									{
										case EnumGoodsBelongsToType.Equipment:
											{
												session.minecraftSessionInfo.BackpackCellNum += mod_Items.modAttributeInfo_Convert.Value;
												attributeAfterVal = session.minecraftSessionInfo.BackpackCellNum;
											}
											break;
										case EnumGoodsBelongsToType.SurvivorEquipment:
											{
												//幸存者装备
											}
											break;
										default:
											break;
									}
								}
								break;
							case EnumAttribute.Atk:
								{
									switch (req.enumGoodsBelongsToTypeTarget)
									{
										case EnumGoodsBelongsToType.Equipment:
											{
												session.minecraftSessionInfo.player.Fight_Attack += mod_Items.modAttributeInfo_Convert.Value;
												attributeAfterVal = session.minecraftSessionInfo.player.Fight_Attack;
											}
											break;
										case EnumGoodsBelongsToType.SurvivorEquipment:
											{
												//幸存者装备
											}
											break;
										default:
											break;
									}
								}
								break;
							default:
								{
									session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = $"错误1：（原因：装备穿戴中，暂不支持该属性枚举值【{mod_Items.modAttributeInfo_Convert.Id}:{mod_Items.modAttributeInfo_Convert.enumAttribute.ToString()}】加点）" });
									return;
								}
						}

						//添加操作影响的positionOptList
						List<BackpackGoodsPositionOpt> positionOptList = new List<BackpackGoodsPositionOpt>();
						positionOptList.Add(new BackpackGoodsPositionOpt
						{
							enumGoodsBelongsToType = goodsInfo.enumGoodsBelongsToType_Convert,
							GoodsPosition = goodsInfo.GoodsPosition,
							guid = goodsInfo.guid
						});
						positionOptList.Add(new BackpackGoodsPositionOpt
						{
							enumGoodsBelongsToType = req.enumGoodsBelongsToTypeTarget,
							GoodsPosition = mod_Player_Parts.Position_Convert,
							guid = req.guid
						});

						//组装响应数据
						List<BackpackCellInfo> posGoodsinfoList = new List<BackpackCellInfo>();
						//获取影响的位置列表（只有两个，一个背包，一个家具）
						positionOptList.ForEach(optItem =>
						{
							//找到受影响的物品位置信息
							posGoodsinfoList.AddRange(session.minecraftSessionInfo.goodsList.Where(m => m.enumGoodsBelongsToType_Convert == optItem.enumGoodsBelongsToType && m.GoodsPosition == optItem.GoodsPosition && m.guid == optItem.guid).GetBackpackGoodsCellInfo());
						});
						//if (posGoodsinfoList.Count() == 1)
						//{
						//	posGoodsinfoList.Add(new BackpackCellInfo
						//	{
						//		enumGoodsBelongsToType = goodsInfo.enumGoodsBelongsToType_Convert,
						//		GoodsItemId = goodsInfo.GoodsItemId,
						//		GoodsList = new List<BackpackGoodsInfo>(),
						//		GoodsPosition = goodsInfo.GoodsPosition,
						//		WastageValue = goodsInfo.WastageValue,
						//		guid = req.guid
						//	});
						//}

						session.minecraftSessionInfo.goodsList.RemoveAll(m => m.Num <= 0);

						List<KeyValueEnumAttributeInt> equipmentAttributeList = new List<KeyValueEnumAttributeInt>();
						equipmentAttributeList.Add(new KeyValueEnumAttributeInt { key = enumAttribute, value = attributeAfterVal });

						var resp = new EquipmentGoodsSattireInResp
						{
							posGoodsinfoList = posGoodsinfoList,
							//enumAttribute = enumAttribute,
							//attributeAfterVal = attributeAfterVal,
							equipmentAttributeList = equipmentAttributeList,
							enumEquipmentGoodsBelongsToType = req.enumGoodsBelongsToTypeTarget,
							guid = req.guid
						};
						session.Send(defCommand, req, resp);
						#endregion
					}
					break;
				case EnumGoodsExchangeObjectType.EquipmentUnsnatch:
					{
						#region EquipmentUnsnatch
						defCommand = EnumCommand.Equipment_EquipmentGoodsUnsnatch;

						//if (JsonConfig.Value.IsDebug)
						//{
						//	req.goodsId = (from info in session.minecraftSessionInfo.goodsList
						//				   where (info.enumGoodsBelongsToType_Convert == EnumGoodsBelongsToType.Equipment)
						//				   select info).ToList().FirstOrDefault().GoodsId;
						//	req.enumEquipmentGoodsUnsnatchMode = EnumEquipmentGoodsUnsnatchMode.Drag;
						//	req.enumGoodsBelongsToType = EnumGoodsBelongsToType.Backpack;

						//	//加载背包物品goodsItem信息
						//	List<BackpackGoodsItemInfo> goodsItemInfoList2 = session.GetBackpackGoodsItemInfoList();

						//	req.targetGoodsPosition = (from info in goodsItemInfoList2
						//							   where info.enumGoodsBelongsToType == req.enumGoodsBelongsToType && info.GoodsNum <= 0
						//							   select info).ToList().FirstOrDefault().GoodsPosition;

						//}
						//物品目的地判断
						if (!MinecraftConfig.bpShortbarBelongsToTypeList.Any(m => m == req.enumGoodsBelongsToTypeTarget))
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = $"错误1：（原因：物品目的地不正确，前端传入的物品目的地为【{req.enumGoodsBelongsToTypeTarget.ToString()}】）" });
							return;
						}
						//装备类型判断
						if (!MinecraftConfig.equipmentBelongsToTypeList.Any(m => m == req.enumGoodsBelongsToTypeSource))
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = $"错误1：（原因：装备类型不正确，前端传入的装备类型为【{req.enumGoodsBelongsToTypeTarget.ToString()}】）" });
							return;
						}

						if (req.guid.IsNullOrWhiteSpace())
						{
							req.guid = "";
						}

						//暂时写死
						if (req.enumGoodsBelongsToTypeSource == EnumGoodsBelongsToType.SurvivorEquipment)
						{
							req.guid = session.minecraftSessionInfo.survivorList.FirstOrDefault(m => m.PlayerId == session.minecraftSessionInfo.player.PlayerId).SurvivorId.ToString();
						}

						//switch (req.enumEquipmentGoodsUnsnatchMode)
						//{
						//	case EnumEquipmentGoodsUnsnatchMode.Click:
						//		break;
						//	case EnumEquipmentGoodsUnsnatchMode.Drag:
						//		{
						var baseResp2 = req.enumGoodsBelongsToTypeTarget.GetBackpackGoodsBelongsToTypeBaseType(req.GoodsPositionTarget, session, "EquipmentGoodsUnsnatch", req.guid);
						if (baseResp2.RespLevel != RespLevelEnum.Success)
						{
							session.Send(defCommand, req, baseResp2);
							return;
						}
						//		}
						//		break;
						//	default:
						//		{
						//			session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误1：（原因：装备物品卸下方式 不存在）" });
						//			return;
						//		}
						//}
						var equipmentInfo = session.minecraftSessionInfo.goodsList.FirstOrDefault(m => m.enumGoodsBelongsToType_Convert == req.enumGoodsBelongsToTypeSource && m.GoodsPosition == req.GoodsPositionSource && m.guid == req.guid);
						if (equipmentInfo == null)
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误1：（原因：装备中不存在该物品）" });
							return;
						}
						//Mod_Items mod_Items = CsvConfig.itemsList.FirstOrDefault(m => m.Id == equipmentInfo.GoodsItemId);
						Mod_Items mod_Items = CsvConfig.GetMod_ItemsInfoById(equipmentInfo.GoodsItemId);
						if (mod_Items == null)
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误1：（原因：物品表中不存在该物品）" });
							return;
						}
						var equipmentTypeList = new List<EnumGoodsType>()
						{
							EnumGoodsType.Equipment,
							EnumGoodsType.Weapon
						};
						if (!equipmentTypeList.Any(m => m == mod_Items.enumGoodsType_Convert))
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误1：（原因：该物品不属于装备，无法卸下，出现这个原因可能是在装备穿戴时就出现了问题）" });
							return;
						}

						//从配置中读取指定物品存放数量上限
						var goodsItemMaxNum = session.GetMaxCellNumConvert(equipmentInfo.GoodsItemId);
						//加载背包物品goodsItem信息
						List<BackpackGoodsItemInfo> goodsItemInfoList = session.GetBackpackGoodsItemInfoList(req.enumGoodsBelongsToTypeTarget, req.guid, out BaseResp baseResp);
						if (baseResp.RespLevel != RespLevelEnum.Success)
						{
							session.Send(defCommand, req, baseResp);
							return;
						}

						Func<BackpackGoodsItemInfo, bool> predicate = null;
						//switch (req.enumEquipmentGoodsUnsnatchMode)
						//{
						//	case EnumEquipmentGoodsUnsnatchMode.Click:
						//		{
						//			predicate = m => (m.GoodsNum <= 0 || m.GoodsItemId == equipmentInfo.GoodsItemId && m.GoodsNum < goodsItemMaxNum) && m.guid == req.guid;
						//		}
						//		break;
						//	case EnumEquipmentGoodsUnsnatchMode.Drag:
						//		{
						predicate = m => (m.enumGoodsBelongsToType == req.enumGoodsBelongsToTypeTarget && m.GoodsPosition == req.GoodsPositionTarget && m.GoodsNum <= 0) && m.guid == req.guid;
						//		}
						//		break;
						//}
						if (predicate == null)
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误1：（原因：服务器错误，predicate 为空）" });
							return;
						}
						//找到背包可以放置的格子信息
						var canCareGoodsInfo = goodsItemInfoList.FirstOrDefault(predicate);
						if (canCareGoodsInfo == null)
						{
							session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = "错误9（原因：格子已经满了，或者不符合卸载条件，装备无法卸载）" });
							return;
						}
						EnumAttribute enumAttribute = mod_Items.modAttributeInfo_Convert.enumAttribute;
						int attributeAfterVal = 0;
						switch (mod_Items.modAttributeInfo_Convert.enumAttribute)
						{
							case EnumAttribute.Def:
								{
									switch (req.enumGoodsBelongsToTypeSource)
									{

										case EnumGoodsBelongsToType.Equipment:
											{
												session.minecraftSessionInfo.player.Fight_Defense -= mod_Items.modAttributeInfo_Convert.Value;
												if (session.minecraftSessionInfo.player.Fight_Defense < 0)
												{
													session.minecraftSessionInfo.player.Fight_Defense = 0;
												}
												attributeAfterVal = session.minecraftSessionInfo.player.Fight_Defense;
											}
											break;
										case EnumGoodsBelongsToType.SurvivorEquipment:
											{
												//幸存者装备
											}
											break;
										default:
											break;
									}


								}
								break;
							case EnumAttribute.BagSize:
								{
									switch (req.enumGoodsBelongsToTypeSource)
									{

										case EnumGoodsBelongsToType.Equipment:
											{
												session.minecraftSessionInfo.BackpackCellNum -= mod_Items.modAttributeInfo_Convert.Value;
												if (session.minecraftSessionInfo.BackpackCellNum < MinecraftConfig.BackpackCellInitNum)
												{
													session.minecraftSessionInfo.BackpackCellNum = MinecraftConfig.BackpackCellInitNum;
												}
												attributeAfterVal = session.minecraftSessionInfo.BackpackCellNum;
											}
											break;
										case EnumGoodsBelongsToType.SurvivorEquipment:
											{
												//幸存者装备
											}
											break;
										default:
											break;
									}
								}
								break;
							case EnumAttribute.Atk:
								{
									switch (req.enumGoodsBelongsToTypeTarget)
									{
										case EnumGoodsBelongsToType.Equipment:
											{
												session.minecraftSessionInfo.player.Fight_Attack -= mod_Items.modAttributeInfo_Convert.Value;
												attributeAfterVal = session.minecraftSessionInfo.player.Fight_Attack;
											}
											break;
										case EnumGoodsBelongsToType.SurvivorEquipment:
											{
												//幸存者装备
											}
											break;
										default:
											break;
									}
								}
								break;
							default:
								{
									session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = $"错误1：（原因：装备卸下中，暂不支持该属性【{mod_Items.modAttributeInfo_Convert.Id}:{mod_Items.modAttributeInfo_Convert.enumAttribute.ToString()}】加点）" });
									return;
								}
						}

						canCareGoodsInfo.GoodsItemId = equipmentInfo.GoodsItemId;
						canCareGoodsInfo.GoodsNum++;
						equipmentInfo.Num--;

						var goodsInfo = session.minecraftSessionInfo.goodsList.FirstOrDefault(m =>
						m.enumGoodsBelongsToType_Convert == canCareGoodsInfo.enumGoodsBelongsToType
						&& m.GoodsPosition == canCareGoodsInfo.GoodsPosition
						&& m.guid == canCareGoodsInfo.guid);
						if (goodsInfo == null)
						{
							goodsInfo = new GoodsModel
							{
								BelongsTo = (int)canCareGoodsInfo.enumGoodsBelongsToType,
								GoodsId = StringHelper.GetGuidStr(),
								GoodsItemId = canCareGoodsInfo.GoodsItemId,
								GoodsPosition = canCareGoodsInfo.GoodsPosition,
								guid = canCareGoodsInfo.guid,
								Num = canCareGoodsInfo.GoodsNum,
								PlayerId = session.minecraftSessionInfo.player.PlayerId,
								WastageValue = 100,
							};
							session.minecraftSessionInfo.goodsList.Add(goodsInfo);
						}
						else
						{
							goodsInfo.Num = canCareGoodsInfo.GoodsNum;
						}

						//session.minecraftSessionInfo.goodsList.Add(new GoodsModel
						//{
						//	BelongsTo = (int)canCareGoodsInfo.enumGoodsBelongsToType,
						//	GoodsId = equipmentInfo.GoodsId,
						//	GoodsItemId = equipmentInfo.GoodsItemId,
						//	GoodsPosition = canCareGoodsInfo.GoodsPosition,
						//	PlayerId = session.minecraftSessionInfo.player.PlayerId,
						//	WastageValue = equipmentInfo.WastageValue,
						//	guid = canCareGoodsInfo.guid,
						//	 Num = 
						//});

						//添加操作影响的positionOptList
						List<BackpackGoodsPositionOpt> positionOptList = new List<BackpackGoodsPositionOpt>();
						positionOptList.Add(new BackpackGoodsPositionOpt
						{
							enumGoodsBelongsToType = equipmentInfo.enumGoodsBelongsToType_Convert,
							GoodsPosition = equipmentInfo.GoodsPosition,
							guid = canCareGoodsInfo.guid,
						});
						positionOptList.Add(new BackpackGoodsPositionOpt
						{
							enumGoodsBelongsToType = canCareGoodsInfo.enumGoodsBelongsToType,
							GoodsPosition = canCareGoodsInfo.GoodsPosition,
							guid = canCareGoodsInfo.guid,
						});
						//组装响应数据
						List<BackpackCellInfo> posGoodsinfoList = new List<BackpackCellInfo>();
						//获取影响的位置列表（只有两个，一个背包，一个家具）
						positionOptList.ForEach(optItem =>
						{
							//找到受影响的物品位置信息
							posGoodsinfoList.AddRange(session.minecraftSessionInfo.goodsList.Where(m => m.enumGoodsBelongsToType_Convert == optItem.enumGoodsBelongsToType && m.GoodsPosition == optItem.GoodsPosition && m.guid == req.guid).GetBackpackGoodsCellInfo());
						});
						//if (posGoodsinfoList.Count() == 1)
						//{
						//	posGoodsinfoList.Add(new BackpackCellInfo
						//	{
						//		enumGoodsBelongsToType = equipmentInfo.enumGoodsBelongsToType_Convert,
						//		GoodsItemId = equipmentInfo.GoodsItemId,
						//		GoodsList = new List<BackpackGoodsInfo>(),
						//		GoodsPosition = equipmentInfo.GoodsPosition,
						//		WastageValue = equipmentInfo.WastageValue,
						//		guid = req.guid
						//	});
						//}

						session.minecraftSessionInfo.goodsList.RemoveAll(m => m.Num <= 0);

						List<KeyValueEnumAttributeInt> equipmentAttributeList = new List<KeyValueEnumAttributeInt>();
						equipmentAttributeList.Add(new KeyValueEnumAttributeInt { key = enumAttribute, value = attributeAfterVal });

						var resp = new EquipmentGoodsUnsnatchResp
						{
							posGoodsinfoList = posGoodsinfoList,
							//enumAttribute = enumAttribute,
							//attributeAfterVal = attributeAfterVal,
							equipmentAttributeList = equipmentAttributeList,
							enumEquipmentGoodsBelongsToType = req.enumGoodsBelongsToTypeSource,
							guid = req.guid
						};
						session.Send(defCommand, req, resp);
						#endregion
					}
					break;
				default:
					{
						session.Send(defCommand, req, new BaseResp { RespLevel = RespLevelEnum.Error, Msg = $"错误1：（原因：针对物品交换接口操作对象类型不正确，前面判断错误，传过来的为【{req.enumGoodsExchangeObjectType.ToString()}】）" });
						return;
					}
					break;
			}
		}
	}
}
